@extends('backend::layout')
@section('title',trans($page_title))
@push('styles')
    <link rel="stylesheet" type="text/css" href="{{asset(config('view.backend.theme.theme2').'/css/wizard.css')}}">
@endpush
@section('content')
    @component('backend::component.form.form')
        @slot('page_title') {{$page_title}}<span class="text-danger">(仅供录入会员使用,操作需谨慎)</span> @endslot
        @slot('formId') add-user @endslot
        @slot('attr') class = wizard @endslot
        @slot('action') {{route('b_User_createUser')}} @endslot
            @component('backend::component.form.form-steps',['steps'=>[
                    ['title'=>'基本信息','href'=>'user-base','icon'=>'hcl-home','is_show'=>true],
                    ['title'=>'安全设置','href'=>'user-auth','icon'=>'hcl-pwd','is_show'=>true],
                    ['title'=>'推荐人','href'=>'user-referrer','icon'=>'hcl-referrer','is_show'=>$default_referrer],
                    ['title'=>'详细信息','href'=>'user-info','icon'=>'hcl-info','is_show'=>true],
                ]])
             @endcomponent
            @include('backend::user.add_section.user_base',['id'=>'user-base'])
            @include('backend::user.add_section.user_auth',['id'=>'user-auth'])
            @includeWhen($default_referrer,'backend::user.add_section.user_referrer',['id'=>'user-referrer'])
            @include('backend::user.add_section.user_info',['id'=>'user-info'])

        @slot('buttons')
            @slot('class') justify-content-end @endslot
            @component('backend::component.form.button')
                @slot('title') 上一步 @endslot
                @slot('elem') a @endslot
                @slot('href') #previous @endslot
                @slot('btn') btn @endslot
                @slot('size') sm @endslot
                @slot('class') d-none step-btn mr-2 @endslot
                @slot('color') danger @endslot
            @endcomponent

            @component('backend::component.form.button')
                @slot('title') 下一步 @endslot
                @slot('elem') a @endslot
                @slot('btn') btn @endslot
                @slot('class') step-btn mr-2 @endslot
                @slot('href') #next @endslot
                @slot('size') sm @endslot
                @slot('color') danger @endslot
            @endcomponent

            @component('backend::component.form.button')
                @slot('title') 提交 @endslot
                @slot('size') sm @endslot
                @slot('params') {"formId":"#add-user","loading":true} @endslot
                @slot('class') btn-min-width ajax-form d-none @endslot
            @endcomponent

        @endslot
    @endcomponent
@endsection
@push('scripts')
    <script src="{{asset(config('view.backend.theme.theme2').'/js/modules/wizard-steps.js')}}"></script>
    <script type="text/javascript">
        layui.use(['interact'], function(){
             $.get("{{route('b_Area_getArea')}}",function (response) {
                var interact = layui.interact;
                interact.render({
                    elem : '.post-area',
                    data : response,
                    name : 'live_area',
                    selected:[8,170,1050],
                    hint : ['请选择省份','请选择城市','请选择县/区'],
                });
            });

        });
    </script>
@endpush